'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, io } = app;
  router.get('/', controller.home.index);
  router.post('/login', controller.login.verify);
  router.post('/ready/establish', controller.ready.establish);
  router.post('/ready/join', controller.ready.join);
  router.get('/operation/:id', controller.operation.deal);
  io.route('establish', app.io.controller.ready.establish);
  io.route('join', app.io.controller.ready.establish);
  io.route('send', app.io.controller.chat.chat);
  io.route('leave', app.io.controller.ready.leave);
  io.route('plan', app.io.controller.room.plan);
  io.route('start', app.io.controller.room.start);
  io.route('bet', app.io.controller.room.bet);
  io.route('call', app.io.controller.room.call);
  io.route('discard', app.io.controller.room.discard);
};
